// index.js
// 获取应用实例
const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
var app = getApp()

Page({
  data: {
    avatarUrl: "",
    nickName: "",
  },
  onChooseAvatar(e) {
    const { avatarUrl } = e.detail 
    this.setData({
      avatarUrl,
    })
  },
  // 事件处理函数
  bindViewTap() {
    

    wx.navigateTo({
      url: '../logs/logs'
    })
  },
  onLoad() {
    var name = wx.getStorageSync("userInfo").nickName;
    var url = wx.getStorageSync('userInfo').avatarUrl;
    console.log( name);
    this.setData({
      nickName: name,
      avatarUrl: url
    })
    if (wx.getUserProfile) {
      this.setData({
        canIUseGetUserProfile: true
      })
    }
  },
  getUserProfile(e) {
    console.log(e);
    // 推荐使用wx.getUserProfile获取用户信息，开发者每次通过该接口获取用户个人信息均需用户确认，开发者妥善保管用户快速填写的头像昵称，避免重复弹窗
    wx.getUserProfile({
      desc: '展示用户信息', // 声明获取用户个人信息后的用途，后续会展示在弹窗中，请谨慎填写
      success: (res) => {
        console.log(res)
        this.setData({
          userInfo: res.userInfo,
          hasUserInfo: true
        })
      }
    })
  },

  ssone() {
    wx.navigateTo({
      url: '/pages/hesuanjiance/hesuanjiance',
    })
  },
  sstow(){
    wx.navigateTo({
      url: '/pages/didian/didian',
    })
  },
  ss3(){
    wx.navigateTo({
      url: '/pages/yimiao/yimiao',
    })
  },
  ss4(){
    wx.navigateTo({
      url: '/pages/didian/didian',
    })
  },
  ss5(){
    wx.navigateTo({
      url: '/pages/didian/didian',
    })
  },
  ss6(){
    wx.navigateTo({
      url: '/pages/didian/didian',
    })
  },
  ss7(){
    wx.navigateTo({
      url: '/pages/didian/didian',
    })
  },
  shezhi(){
    wx.navigateTo({
      url: '/pages/shezhi/shezhi',
    })
  },
})